package com.cloudcode.repository;

import co.elastic.clients.elasticsearch.core.SearchRequest;
import com.cloudcode.document.DocumentContent;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Highlight;
import org.springframework.data.elasticsearch.annotations.HighlightField;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author yunst
 */
@Component
public interface DocumentRepository extends ElasticsearchRepository<DocumentContent, String> {
    @Highlight(fields = {
            @HighlightField(name = "content"),
    })
    SearchHits<DocumentContent> findByContent(String keyword);

}
